package jp.aist.gtrc.plus.admission.EDF.simulation;

import jp.aist.gtrc.plus.admission.EDF.*;

public class CPUInfo {
   private Job executingJob = null;
   private int totalUsageTime = 0;

   public void executeJob(Job job) {
      if ( (job != null) && (executingJob != null)) {
         throw new RuntimeException("Trying to dispatch job to busy CPU");
      }
      this.executingJob = job;
   }

   public boolean isIdle() {
      if (executingJob == null) {
         return true;
      } else {
         return false;
      }
   }

   public int getTotalUsageTime() {
      return this.totalUsageTime;
   } 

   public void addUsageTime(int usageTime) {
      this.totalUsageTime = this.totalUsageTime + usageTime; 
   }
}

